import { world } from "@minecraft/server";
import { WereWolfPlayerStateUpdater } from "@/werewolf/components/playerUpdate";
import { WereWolfModule } from "@/werewolf/module";

export class WereWolfBeforeNightPhase extends WereWolfModule.State {
    override onEnter(): void {
        this.context.day += 1;
        this.addComponent(WereWolfPlayerStateUpdater);
        this.context.players.forEach((p) => p.clear());
        world.gameRules.pvp = true;

        this.addComponents(this.context.map.phaseViews.beforeNight);
    }

    next() {
        this.popState();
    }
}
